package com.yanu.t2s.controller;

import com.yanu.t2s.entity.Lingshou;
import com.yanu.t2s.service.LingshouService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//零售商Controller
@CrossOrigin
@RestController
@RequestMapping("lingshou")
public class LingshouController {
    @Autowired
    LingshouService lingshouService;

    @GetMapping("get/{id_lingshou}")
    public Lingshou findByIdLingshou(@PathVariable int id_lingshou) {
        return lingshouService.findByIdLingshou(id_lingshou);
    }

    @GetMapping("get/all")
    public List<Lingshou> findAllLingshou() {
        return lingshouService.findAllLingshou();
    }
}
